]>
Commit | Line | Data |
---|---|---|
54bf965f P |
1 | IDENTIFICATION DIVISION |
2 | PROGRAM-ID ChargeInEMfield | |
3 | VERSION 20240116 | |
4 | COMMENT A mass m with charge q>0 is located in a static electro-magnetic field [0,0,E], [0,-B,0]. | |
5 | COMMENT Find the trajetory | |
6 | COMMENT Differential equation (Lorentz force): x'' = omega*z', z'' = a*omega^2 - omega*x' | |
7 | COMMENT good start settings are omega=0,92, a*omega^2=0,05 | |
8 | ||
9 | ENVIRONMENT DIVISION | |
10 | ENGINE Anabrid-THAT | |
f25252dd | 11 | TIMEBASE 1ms # corresponds to 1s |
6e8a1392 | 12 | REQUIRES INTEGRATOR 4, INVERTER 1, COEFFICIENT 3 |
54bf965f P |
13 | |
14 | DATA DIVISION | |
15 | OUTPUT OUTPUT.X x | |
16 | OUTPUT OUTPUT.Z z | |
6e8a1392 P |
17 | COEFFICIENT.1 OMEGA_X # -omega for x' |
18 | COEFFICIENT.2 A*OMEGA^2 | |
19 | COEFFICIENT.3 OMEGA_z # omega for z' | |
54bf965f P |
20 | |
21 | PROGRAM DIVISION | |
6e8a1392 P |
22 | x'' -> INTEGRATOR -> -x' |
23 | -x' -> INTEGRATOR -> x | |
24 | -x' -> COEFFICIENT.OMEGA_X -> -omega*x' | |
25 | +1 -> COEFFICIENT.A*OMEGA^2 -> a*omega^2 | |
26 | a*omega^2, -omega*x' -> INTEGRATOR -> -z' # input is z'' | |
27 | -z' -> INTEGRATOR -> z | |
28 | -z' -> INVERTER -> z' | |
29 | z' -> COEFFICIENT.OMEGA_Z -> omega*z' = x'' | |
54bf965f P |
30 | |
31 | OPERATION DIVISION | |
32 | MODE REPEAT | |
ae9d78b7 | 33 | OP-TIME 21ms |